<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <STYLE>
    .active {
      color: red;
    }
  </STYLE>
</head>
<body>
<div id="app">
  <ul>
    <li v-for="(item, index) in movies"
        :class="{active: currentIndex === index}"
        @click="liClick(index)">
      {{index}}.{{item}}
    </li>
  </ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      movies: ['老人与海', '钢铁侠', '铁胆火车侠', '绿巨人'],
      currentIndex: 0
    },
    methods: {
      liClick(index) {
        this.currentIndex = index
      }
    }

  })


</script>
</body>
</html>
